<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="GENERATOR" content="Mozilla/4.78 [en] (Win98; U) [Netscape]">
   <title>Globals: Scene Info</title>
<style type="text/css"><!--tt { font-size: 10pt } pre { font-size: 10pt }--></style>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#000080" vlink="#800000" alink="#0000FF">
&nbsp;
<table BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR="#D0D0D0" >
<tr>
<td ALIGN=LEFT WIDTH="120"><a href="raster.html"><img SRC="navlt.gif" ALT="Raster Services" BORDER=0 height=20 width=96></a></td>

<td ALIGN=LEFT WIDTH="96"><a href="sceneobj.html"><img SRC="navrt.gif" ALT="Scene Objects" BORDER=0 height=20 width=64></a></td>

<td ALIGN=LEFT WIDTH="96"><a href="../globals.html"><img SRC="navup.gif" ALT="Globals" BORDER=0 height=20 width=56></a></td>

<td ALIGN=RIGHT WIDTH="288"><a href="../index.html"><img SRC="proglw.gif" ALT="Table of Contents" BORDER=0 height=20 width=230></a></td>
</tr>
</table>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0 >
<tr>
<td WIDTH="600">
<h3>
Scene Info</h3>
<font size=-1><b>Availability</b>&nbsp; LightWave 6.0</font>
<br><font size=-1><b>Component</b>&nbsp; Layout</font>
<br><font size=-1><b>Header</b>&nbsp; <a href="../../include/lwrender.h">lwrender.h</a></font>
<p>The scene info global returns information about the current scene. This
information is read-only and reflects the state of the scene at the time
the global function is called. You can set these parameters using <a href="../commands/layout.html#scenes">commands</a>.
<p><b>Global Call</b>
<pre>&nbsp;&nbsp; LWSceneInfo *sceneinfo;
&nbsp;&nbsp; sceneinfo = global( LWSCENEINFO_GLOBAL, GFUSE_TRANSIENT );</pre>
The global function returns a pointer to an LWSceneInfo.
<pre>&nbsp;&nbsp; typedef struct st_LWSceneInfo {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const char *<b>name</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const char *<b>filename</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>numPoints</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>numPolygons</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>renderType</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>renderOpts</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LWFrame&nbsp;&nbsp;&nbsp;&nbsp; <b>frameStart</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LWFrame&nbsp;&nbsp;&nbsp;&nbsp; <b>frameEnd</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LWFrame&nbsp;&nbsp;&nbsp;&nbsp; <b>frameStep</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>framesPerSecond</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>frameWidth</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>frameHeight</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>pixelAspect</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>minSamplesPerPixel</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>maxSamplesPerPixel</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>limitedRegion</b>[4];
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>recursionDepth</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LWItemID&nbsp;&nbsp; (*<b>renderCamera</b>) (LWTime);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>numThreads</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const char <b>*animFilename</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const char <b>*RGBPrefix</b>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const char <b>*alphaPrefix</b>;
&nbsp;&nbsp; } LWSceneInfo;</pre>

<dl>
<dt>
<b><tt>name</tt></b></dt>

<dd>
User's name for the scene.&nbsp;</dd>

<dt>
</dt>

<br><b><tt>filename</tt></b>
<dd>
Filename of the scene file.&nbsp;</dd>

<dt>
</dt>

<br><tt><b>numPoints</b>, <b>numPolygons</b></tt>
<dd>
Total number of points and polygons for all the objects in the scene.</dd>

<dt>
</dt>

<br><b><tt>renderType</tt></b>
<dd>
The render type, which can be one of the following.&nbsp;</dd>

<pre>LWRTYPE_WIRE
LWRTYPE_QUICK
LWRTYPE_REALISTIC</pre>

<dt>
<b><tt>renderOpts</tt></b></dt>

<dd>
This is a combination of bits for different rendering options. The bit
flags are&nbsp;</dd>

<pre>LWROPT_SHADOWTRACE
LWROPT_REFLECTTRACE
LWROPT_REFRACTTRACE
LWROPT_FIELDS
LWROPT_EVENFIELDS
LWROPT_MOTIONBLUR
LWROPT_DEPTHOFFIELD
LWROPT_LIMITEDREGION
LWROPT_PARTICLEBLUR
LWROPT_ENHANCEDAA
LWROPT_SAVEANIM
LWROPT_SAVERGB
LWROPT_SAVEALPHA
</pre>
<tt>LWROPT_EVENFIELDS</tt> is set only if field rendering is on and the
first line of the output image is from the field that comes first in time.&nbsp;
<dt>
<tt><b>frameStart</b>, <b>frameEnd</b></tt></dt>

<dd>
The numbers of the first and last frame defined for the scene. These are
the rendering limits, not to be confused with the limits set by the user
for previews (which you can get from the <a href="intinfo.html">interface
info</a> global).</dd>

<dt>
</dt>

<br><b><tt>frameStep</tt></b>
<dd>
The step size, in frames, during rendering (the user setting for the Frame
Step).</dd>

<dt>
</dt>

<br><b><tt>framesPerSecond</tt></b>
<dd>
Number of frames per playback second. This will ordinarily be 24 for film,
30 for NTSC video and 25 for PAL video. Note that this is the number of
frames, not fields.</dd>

<dt>
</dt>

<br><tt><b>frameWidth</b>, <b>frameHeight</b></tt>
<dd>
Rendered image size in pixels.&nbsp;</dd>

<dt>
</dt>

<br><b><tt>pixelAspect</tt></b>
<dd>
The aspect ratio of the pixels in the image, expressed as width/height.
Values greater than 1.0 mean short wide pixels and values less than 1.0
mean tall thin pixels.&nbsp;</dd>

<dt>
</dt>

<br><tt><b>minSamplesPerPixel</b>, <b>maxSamplesPerPixel</b></tt>
<dd>
Limits on the number of samples per pixel in the final image. Because of
different rendering techniques and adaptive sampling it is impossible to
compute a precise number of antialiasing samples at any pixel, but this
gives a range for the current rendering options.&nbsp;</dd>

<dt>
</dt>

<br><b><tt>limitedRegion</tt></b>
<dd>
The extents of the limited region area, in pixels. The extents are given
in the order x0, y0, x1, y1.</dd>

<dt>
</dt>

<br><b><tt>recursionDepth</tt></b>
<dd>
The maximum recursion depth for raytracing.</dd>

<dt>
</dt>

<br><tt>camID = <b>renderCamera</b>( time )</tt>
<dd>
Returns the item ID of the camera that will render the frame at the specified
time.</dd>

<dt>
&nbsp;</dt>

<dt>
<b><tt>numThreads</tt></b></dt>

<dd>
The number of threads of execution that will be used during rendering.</dd>

<dd>
</dd>

<br><b><tt>animFilename</tt></b>
<dd>
The name of the current animation file.</dd>

<dl>
<dd>
</dd>
</dl>
<b><tt>RGBPrefix</tt></b>&nbsp;
<dd>
The current RGB file saving&nbsp; prefix</dd>

<dd>
</dd>

<br><b><tt>AlphaPrefix</tt></b>
<dd>
The current RGB file saving&nbsp; prefix</dd>
</dl>
<b>Example</b>
<p>This code fragment calculates the running time and frame aspect.
<pre>&nbsp;&nbsp; #include &lt;lwserver.h>
&nbsp;&nbsp; #include &lt;lwrender.h>

&nbsp;&nbsp; LWSceneInfo *lwsi;
&nbsp;&nbsp; double duration, frameAspect;

&nbsp;&nbsp; lwsi = global( LWSCENEINFO_GLOBAL, GFUSE_TRANSIENT );

&nbsp;&nbsp; if ( lwsi ) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; duration = ( lwsi->frameEnd - lwsi->frameStart + 1 )
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; / lwsi->framesPerSecond;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frameAspect = lwsi->pixelAspect * lwsi->frameWidth
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; / lwsi->frameHeight;
&nbsp;&nbsp; }</pre>
</td>
</tr>

<tr>
<td></td>
</tr>
</table>

</body>
</html>
